#include "imbus_internal.h"
#include "im_address.h"

static IMBool
__im_address_set (IMAddress *address, const char *addr_string)
{
    return FALSE;
}

static const char*
__im_address_get (const IMAddress *address)
{
    return 0;
}

static const char*
__im_address_get_type_name (const IMAddress *address)
{
    return 0;
}

static IMBool
__im_address_valid (const IMAddress *address)
{
    return FALSE;
}

static void
__im_address_class_init (IMPointer klass)
{
    IMAddressClass *acp = (IMAddressClass *)klass;

    acp->set                    = __im_address_set;
    acp->get                    = __im_address_get;
    acp->get_type_name          = __im_address_get_type_name;
    acp->valid                  = __im_address_valid;
}

static void
__im_address_initialize (IMPointer obj)
{
}

static void
__im_address_finalize (IMPointer obj)
{
}

void
__im_type_register_address ()
{
    static IMTypeInfo im_address_type_info =
    {
        sizeof (IMAddressClass), /**< class_size >**/
        __im_address_class_init, /**< class_init >**/
        0,                       /**< class_finalize >**/

        sizeof (IMAddress),      /**< instance_size >**/
        __im_address_initialize, /**< instance_init >**/
        __im_address_finalize,   /**< instance_finalize >**/
    };

    __im_type_register_builtin_class (IM_TYPE_OBJECT,
                                      IM_TYPE_ADDRESS,
                                      "Address",
                                      &im_address_type_info,
                                      FALSE);
}

IMAddress*
im_address_new (const char *addr_string)
{
    return 0;
}

IMBool
im_address_set (IMAddress *address, const char *addr_string)
{
    _im_return_val_if_fail (IM_IS_ADDRESS(address), FALSE);
    _im_return_val_if_fail (addr_string && *addr_string, FALSE);
    return IM_ADDRESS_GET_CLASS(address)->set (address, addr_string);
}

const char *
im_address_get (const IMAddress *address)
{
    _im_return_val_if_fail (IM_IS_ADDRESS(address), 0);
    return IM_ADDRESS_GET_CLASS(address)->get (address);
}

const char *
im_address_get_type_name (const IMAddress *address)
{
    _im_return_val_if_fail (IM_IS_ADDRESS(address), 0);
    return IM_ADDRESS_GET_CLASS(address)->get_type_name (address);
}

IMBool
im_address_valid (const IMAddress *address)
{
    _im_return_val_if_fail (IM_IS_ADDRESS(address), FALSE);
    return IM_ADDRESS_GET_CLASS(address)->valid (address);
}

/*
vi:ts=4:nowrap:ai:expandtab
*/
